import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-04-27  19:28
 */
public class Test2 {
    public static void transform(int[] array) {
        for (int i = 0; i < array.length; i++) {
            if(array[i] % 2 == 0) {
                int tmp = array[i];
                array[i] = array[i+1];
                array[i+1] = tmp;
                i--;
            }
        }
    }
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5};
        transform(array);
        System.out.println(Arrays.toString(array));
    }
}
